package cn.edu.lingnan.dao;

import cn.edu.lingnan.pojo.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentMapper {
    @Insert("insert into school1.student (sid, sname, spassword, sright, sflag) " +
            "values (#{sid},#{sname},#{password},#{sright},#{sflag})")
    Integer insert(Student student);

    @Select("select * from school1.student where sid=#{sid}")
    Student getStudentByID(String sid);
    @Select("select * from school1.student where sname like CONCAT(#{sname},'%')")
    List<Student> getStudentLikeName(String sname);

    Integer updateById(Student student);

    @Delete("delete from school1.student where sid=#{sid}")
    Integer deleteById(String sid);
}
